<%-- 
    Document   : exito
    Created on : 15/06/2013, 06:21:39 PM
    Author     : PabloJesus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean  id="persona" scope="request" class="beans.Persona" />
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="js/script.js?1.0.1" type="text/javascript"></script>
        <script src="js/jquery.js?1.0.1" type="text/javascript"></script>
        <title>Formulario Persona</title>
    </head>
    <body>        
        <h1>
            ${mensaje}
        </h1>        
        <br/>
        <form action="registrarPersona.srv" method="POST">
            <table>
                <thead>
                    <tr>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>ID</td>
                        <td>
                            <input type="text" name="txtId" value="${persona.id}" maxlength="8" size="25" <c:if test="${esNuevo eq false}">readonly</c:if> />
                        </td>
                    </tr>
                    <tr>
                        <td>Nombres</td>
                        <td>
                            <input type="text" name="txtNombres" value="${persona.nombres}" size="25"  maxlength="40"/>
                        </td>
                    </tr>
                    <tr>
                        <td>Apellido Paterno</td>
                        <td>
                            <input type="text" name="txtApellidoPaterno" value="${persona.apellidoPaterno}" size="25"  maxlength="25" />
                        </td>
                    </tr>
                    <tr>
                        <td>Apellido Materno</td>
                        <td>
                            <input type="text" name="txtApellidoMaterno" value="${persona.apellidoMaterno}" size="25"  maxlength="25" />
                        </td>
                    </tr>
                    <tr>
                        <td>Fecha de Nacimiento</td>
                        <td>
                            <input type="date" name="txtFechaNacimiento" value="${persona.fechaNacimiento}" size="10" />
                        </td>
                    </tr>
                    <tr>
                        <td>G&eacute;nero</td>
                        <td>       
                            <select name="cmbGenero" >                                
                                <option value="m" <c:if test="${fn:contains(persona.genero,'m')}"> selected=""</c:if> >Masculino</option>
                                <option value="f" <c:if test="${fn:contains(persona.genero,'f')}"> selected=""</c:if> >Femenino</option>
                                <option value="o" <c:if test="${fn:contains(persona.genero,'o')}"> selected=""</c:if> >Otro</option>
                            </select>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div>
                <input type="submit" value="Guardar"/>
                <input type="button" onclick="document.location='crudPersona.srv'" value="Cancelar"/>
            </div>
        </form>
    </body>
</html>